OP.navigation = (function(){
	var currentnav = null, container = null;
	return{
		init: function(){
			if(!document.getElementById(container)) return;
			var elems = document.getElementById(container).getElementsByTagName('li'),
				i;
			if(!document.getElementById(container)) return false;
			
			for(i=0; i < elems.length; i++){
				OP.utility.observe(elems[i],'mouseover',OP.navigation.onHover);
				OP.utility.observe(elems[i],'mouseout',OP.navigation.onOut);
			}
		},
		
		onHover: function(){
			currentnav = this.className == undefined ? event.srcElement : this;

			if(currentnav.parentNode.parentNode.parentNode.id != container) return;
			
			if(currentnav.className != ''){
				classes = currentnav.className.split('\s');
				if(!('display' in classes)){
					currentnav.className += ' display';
				}
			}
			else currentnav.className = 'display';
		},
		
		onOut: function(){
			if(currentnav != null)
				currentnav.className = currentnav.className.replace(/(\s)*display/,''); // remove display class when hover out
		},
		
		setContainer: function(){
			container = arguments[0];
		}
	}
})();

OP.navigation.setContainer('op_navigation');
OP.utility.addLoadProcess(OP.navigation.init);